package com.xuetang9.fujian.net.reponse;

import com.xuetang9.fujian.model.Group;
import com.xuetang9.fujian.model.User;
import com.xuetang9.fujian.net.client.Client;
import com.xuetang9.fujian.view.WindowManager;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @describe:
 * @author:fujian
 * @date:2021/6/13
 * @Version: V1.0
 * @Package: com.xuetang9.fujian.net.reponse
 */
@SuppressWarnings("all")
public class LoadRelationResponseHandler extends AbstractResponseHandler{
    @Override
    public void handleRequest(HashMap<String, Object> message, Client client) {
        boolean success = (boolean) message.get("success");
        if (success){
            Map<Group, List<String >> group = (Map<Group, List<String>>) message.get("group");
            List<User> relationPersons = (List<User>) message.get("relationPersons");
            WindowManager.getMainFrame().loadRelationPersons(group,relationPersons);
        }
    }
}
